3 * https://www.mediawiki.org/wiki/OOUI
5 * Copyright 2011–2018 OOUI Team and other contributors.
6 * Released under the MIT license
7 * http://oojs.mit-license.org
9 * Date: 2018-03-23T23:42:32Z
17 * @extends OO.ui.Theme
21 OO
.ui
.WikimediaUITheme
= function OoUiWikimediaUITheme() {
23 OO
.ui
.WikimediaUITheme
.parent
.call( this );
28 OO
.inheritClass( OO
.ui
.WikimediaUITheme
, OO
.ui
.Theme
);
35 OO
.ui
.WikimediaUITheme
.prototype.getElementClasses = function ( element
) {
37 var variant
, isFramed
, isActive
, isToolOrGroup
,
45 classes
= OO
.ui
.WikimediaUITheme
.parent
.prototype.getElementClasses
.call( this, element
);
47 if ( element
.supports( [ 'hasFlag' ] ) ) {
48 isFramed
= element
.supports( [ 'isFramed' ] ) && element
.isFramed();
49 isActive
= element
.supports( [ 'isActive' ] ) && element
.isActive();
51 ( OO
.ui
.Tool
&& element
instanceof OO
.ui
.Tool
) ||
52 ( OO
.ui
.ToolGroup
&& element
instanceof OO
.ui
.ToolGroup
);
54 // Button with a dark background
55 isFramed
&& ( isActive
|| element
.isDisabled() || element
.hasFlag( 'primary' ) ) ||
56 // Toolbar with a dark background
57 isToolOrGroup
&& element
.hasFlag( 'primary' )
59 // … use white icon / indicator, regardless of other flags
60 variants
.invert
= true;
61 } else if ( !isFramed
&& element
.isDisabled() ) {
62 // Frameless disabled button, always use black icon / indicator regardless of other flags
63 variants
.invert
= false;
64 } else if ( !element
.isDisabled() ) {
65 // Any other kind of button, use the right colored icon / indicator if available
66 variants
.progressive
= element
.hasFlag( 'progressive' ) ||
67 // Active tools/toolgroups
68 ( isToolOrGroup
&& isActive
) ||
69 // Pressed or selected outline option widgets
71 OO
.ui
.OutlineOptionWidget
&& element
instanceof OO
.ui
.OutlineOptionWidget
&&
72 ( element
.isPressed() || element
.isSelected() )
75 variants
.destructive
= element
.hasFlag( 'destructive' );
76 variants
.warning
= element
.hasFlag( 'warning' );
80 for ( variant
in variants
) {
81 classes
[ variants
[ variant
] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant
);
90 OO
.ui
.WikimediaUITheme
.prototype.getDialogTransitionDuration = function () {
96 OO
.ui
.theme
= new OO
.ui
.WikimediaUITheme();
100 //# sourceMappingURL=oojs-ui-wikimediaui.js.map